import axios from 'axios'
import Vue from 'vue'
import {Toast} from 'vant'


axios.defaults.baseURL = 'http://112.74.99.5:3000/web/api',
axios.defaults.timeout =3000,

axios.interceptors.request.use(config=>{
    Toast.loading({ message: '加载中...', loadingType: 'spinner',})
    let token = localStorage.getItem('token')
    if(token){
        config.headers.Authorization = token
    }
},error=> new Promise.reject(error))

axios.interceptors.response.use(res=>{
    return res
    Toast.clear()
},error=>{
    
})
export default axios

    